package org.dangran.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class KafkaController {


    @Autowired
    private KafkaTemplate<String,Object> kafkaTemplate;


    @GetMapping("/kafka/{msg}")
    public void sendKafkaMsg(@PathVariable("msg")String msg){
        kafkaTemplate.send("testTopic",msg);
    }



}
